package com.demo.enums;

/**
 * 消息级别
 */
public enum MessageRankEnum {
    ADD(1, "新增"),
    OFF_LINE(2, "下线");

    private int value;
    private String desc;

    MessageRankEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static MessageRankEnum getByValue(Integer value) {
        for (MessageRankEnum item : values()) {
            if (item.getValue() == value) {
                return item;
            }
        }
        return null;
    }
}
